export function updateLayoutViewOptions (state, options) {
	let arr = [];
	for (let y in options){
		if(options.hasOwnProperty(y)){
			let yo = options[y];
			for (let x in yo){
				if(yo.hasOwnProperty(x)){
					let xo = yo[x];
					arr.push(xo.model);
				}
			}
		}
	}
	state.view = arr[0] + arr[1] + arr[2] + ' ' +arr[3]+arr[4]+arr[5]+' '+arr[6]+arr[7]+arr[8];
}

import { colors } from 'quasar'

export function updateState(state, options) {
	for (let key in options){
		if(options.hasOwnProperty(key) && state.hasOwnProperty(key)){
			if(state[key] !== options[key]){
				if(key === 'theme'){
					for (let color in options[key]){
						if(options[key].hasOwnProperty(color)){
							colors.setBrand(color, options[key][color]);
						}
					}
				}
				if(typeof options[key] === 'object'){
					Object.assign(state[key], options[key]);
				}else{
					state[key] = options[key];
				}
			}
		}
	}
}
